package com.sphd.emanu.activity.pointrecharge;

import android.content.Context;

import com.google.gson.JsonObject;
import com.sphd.emanu.mvp.BasePresenterImpl;
import com.wzutils.L;

import java.math.BigDecimal;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * MVPPlugin
 *  邮箱 784787081@qq.com
 */

public class PointRechargePresenter extends BasePresenterImpl<PointRechargeContract.View> implements PointRechargeContract.Presenter{

    @Override
    public void updateDepositPoints(Integer id, boolean enable, BigDecimal amount, Integer ponits) {
            emanuService.updateDepositPoints(id, enable, amount, ponits).enqueue(new Callback<JsonObject>() {
                @Override
                public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
                    L.e(response.toString());
                    mView.upRes(res(response));
                }

                @Override
                public void onFailure(Call<JsonObject> call, Throwable t) {
                    Error(t);
                }
            });
    }
}
